﻿using System;
using System.ServiceModel;
using System.ServiceProcess;
using ScottLane.MediaFeeder.WebService;

namespace ScottLane.MediaFeeder.Host
{
    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// http://cmdlineservice.codeplex.com/Wiki/View.aspx?title=Home
    /// </remarks>
    public class MediaFeederService : ServiceBase
    {
        ServiceHost serviceHost;

        public MediaFeederService()
        {
            this.ServiceName = "Media Feeder";
        }

        protected override void OnStart(string[] args)
        {
            serviceHost = new ServiceHost(typeof(MediaService));
            serviceHost.Open();
        }

        protected override void OnStop()
        {
            if (serviceHost != null)
            {
                serviceHost.Close();
            }
        }
    }
}
